import heapq
import functools
class Solution(object):
    def maximumProduct(self, nums, k):
        heapq.heapify(nums)
        while k:
            node = heapq.heappop(nums)
            heapq.heappush(nums, node + 1)
            k -= 1
        def mul(x1, x2):
            return x1 * x2 % (10 ** 9 + 7)
        return functools.reduce(mul, nums)
